package 代码记录.指定公司代码练习记录.华为_2024.分值100;

import java.util.Scanner;

/**
 * @author zx
 * @create 2024-01-28 21:33
 */
public class 最长连续子串_5 {
    /**
     * 参考人家的思路(改编)
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int max = -1;
        for(int i = 0,j = 1;i < s.length() && j < s.length();){
            j++;
            String str = s.substring(i,j);
            boolean flag = false;
            //使用正则表达式将str中[i,j]位置中的数字置为""
            String replaceStr = str.replaceAll("[0-9]","");
            flag = replaceStr.length() != str.length() && replaceStr.length() == 1;
            if(flag){
                max = Math.max(max,str.length());
            }else{
                i++;
            }
        }
        System.out.println(max);
    }
}
